package com.guomao.controller;

import com.guomao.entity.User;
import com.guomao.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {

    //    @Autowired
    @Resource
    private UserService userService;

    @GetMapping("/getUser/{id}")
    public User findByID(@PathVariable("id") Long id) {
        System.out.println("user 8082...");
        return userService.getById(id);
    }
}